package com.chmingx.admin.config;

import com.chmingx.admin.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class AdminWebConfig implements WebMvcConfigurer {

    /**
     * 配置拦截器，将拦截器注入到容器中
     * @param registry
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(new LoginInterceptor())
//                .addPathPatterns("/**") //拦截所有请求，包括静态资源请求
//                .excludePathPatterns("/login", "/css/**", "/fonts/**", "/js/**", "/images/**", "/file"); // 要放行的请求
    }
}
